<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./函数2次封装.js"></script>
</head>
<body>
    <script>



      function sum(a,b){
        const c=this.c?this.c:0;
        return a+b+c;
      }
      const obj={
        c:100
      }
       const a=sum.bind(obj);
       const b=sum;
       const c=bind(sum,obj)
       const d=bind(sum,obj,3,5)
      console.log(a(1,2)) //103
      console.log(b(1,2)) //3
      console.log(c(1,2))//103
      console.log(d(1,2))//108,1和2已经被3和5占用
    </script>
</body>
</html>